#include "createroomresp.h"
#include "getroomlistresp.h"

CreateRoomResp::CreateRoomResp() : ProtoSrvResp(PT_RESP_CREATE_ROOM)
{
}

CreateRoomResp::CreateRoomResp(qint32 result) : ProtoSrvResp(PT_RESP_CREATE_ROOM)
{
    _result = result;
}

bool CreateRoomResp::encode(ACE_OutputCDR &cdr)
{
    cdr << ACE_CDR::Long(_result);
    return cdr.good_bit();
}

ProtoSrv* CreateRoomResp::decode(ACE_InputCDR &cdr)
{
    ACE_CDR::Long result;

    if(cdr >> result)
        return new CreateRoomResp(result);

    return 0;
}
